home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 6 / CU Amiga Magazine's Super CD-ROM 06 (1996)(EMAP Images)(GB)(Track 1 of 4)[!][issue 1997-01].iso / cucd / prog / mui / muibuilder / mb / gcc / inline / muimaster.h
C/C++ Source or Header  |  1995-06-22  |  7KB  |  289 lines

  1. #ifndef _INLINE_MUIMASTER_H
  2. #define _INLINE_MUIMASTER_H
  3.  
  4. #include <sys/cdefs.h>
  5. #include <inline/stubs.h>
  6.  
  7. __BEGIN_DECLS
  8.  
  9. #ifndef BASE_EXT_DECL
  10. #define BASE_EXT_DECL /*extern struct Library* MUIMasterBase;*/
  11. #endif
  12. #ifndef BASE_PAR_DECL
  13. #define BASE_PAR_DECL
  14. #define BASE_PAR_DECL0 void
  15. #endif
  16. #ifndef BASE_NAME
  17. #define BASE_NAME MUIMasterBase
  18. #endif
  19.  
  20. extern struct Library* MUIMasterBase;
  21.  
  22.   __inline
  23. APTR MUI_AllocAslRequest( BASE_PAR_DECL unsigned long type, struct TagItem *tagList)
  24.  
  25. {
  26.   BASE_EXT_DECL
  27.   register APTR res __asm("d0");
  28.   register struct Library* a6 __asm("a6") = BASE_NAME;
  29.   register unsigned long d0 __asm("d0") = type;
  30.   register struct TagItem* a0 __asm("a0") = tagList;
  31.  
  32.   __asm volatile ("jsr a6@(-0x30)"
  33.   : "=r" (res)
  34.   : "r" (a6), "r" (d0), "r" (a0)
  35.   : "d0","d1", "a0", "a1", "memory" );
  36.   return res;
  37. }
  38.  
  39.   APTR MUI_AllocAslRequestTags(ULONG type, Tag tag1, ...);
  40.  
  41. __inline
  42. BOOL MUI_AslRequest( BASE_PAR_DECL APTR requester, struct TagItem *tagList)
  43. {
  44.   BASE_EXT_DECL
  45.   register BOOL res __asm("d0");
  46.   register struct Library* a6 __asm("a6") = BASE_NAME;
  47.   register APTR a0 __asm("a0") = requester;
  48.   register struct TagItem* a1 __asm("a1") = tagList;
  49.  
  50.   __asm volatile ("
  51.   jsr a6@(-0x36)"
  52.   : "=r" (res)
  53.   : "r" (a6), "r" (a0), "r" (a1)
  54.   : "d0", "d1", "a0", "a1" );
  55.   return res;
  56. }
  57.   BOOL MUI_AslRequestTags(APTR req, Tag tag1, ...);
  58.  
  59.  
  60. __inline
  61. struct MUI_CustomClass*
  62. MUI_CreateCustomClass( BASE_PAR_DECL struct Library *base, char *supername, struct MUI_CustomClass *supermcc, int datasize, APTR dispatcher)
  63. {
  64.   BASE_EXT_DECL
  65.   register struct MUI_CustomClass* res __asm("d0");
  66.   register struct Library* a6 __asm("a6") = BASE_NAME;
  67.   register struct Library* a0 __asm("a0") = base;
  68.   register char* a1 __asm("a1") = supername;
  69.   register struct MUI_CustomClass* a2 __asm("a2") = supermcc;
  70.   register int d0 __asm("d0") = datasize;
  71.   register APTR a3 __asm("a3") = dispatcher;
  72.  
  73.   __asm volatile ("
  74.   jsr a6@(-0x6c)"
  75.   : "=r" (res)
  76.   : "r" (a6), "r" (a0), "r" (a1), "r" (a2), "r" (d0), "r" (a3)
  77.   : "d0", "d1", "a0", "a1", "a2", "a3" );
  78.   return res;
  79. }
  80.   __inline
  81. BOOL MUI_DeleteCustomClass( BASE_PAR_DECL struct MUI_CustomClass* mcc)
  82. {
  83.   BASE_EXT_DECL
  84.   register BOOL res __asm("d0");
  85.   register struct Library* a6 __asm("a6") = BASE_NAME;
  86.   register struct MUI_CustomClass* a0 __asm("a0") = mcc;
  87.  
  88.   __asm volatile ("
  89.   jsr a6@(-0x72)"
  90.   : "=r" (res)
  91.   : "r" (a6), "r" (a0)
  92.   : "d0", "d1", "a0", "a1" );
  93.   return res;
  94. }
  95.   __inline void MUI_DisposeObject( BASE_PAR_DECL Object *obj)
  96. {
  97.   BASE_EXT_DECL
  98.   register res __asm("d0");
  99.   register struct Library* a6 __asm("a6") = BASE_NAME;
  100.   register Object* a0 __asm("a0") = obj;
  101.  
  102.   __asm volatile ("
  103.   jsr a6@(-0x24)"
  104.   : "=r" (res)
  105.   : "r" (a6), "r" (a0)
  106.   : "d0", "d1", "a0", "a1" );
  107. }
  108.   __inline LONG MUI_Error( BASE_PAR_DECL0 )
  109. {
  110.   BASE_EXT_DECL
  111.   register LONG res __asm("d0");
  112.   register struct Library* a6 __asm("a6") = BASE_NAME;
  113.  
  114.   __asm volatile ("
  115.   jsr a6@(-0x42)"
  116.   : "=r" (res)
  117.   : "r" (a6)
  118.   : "d0", "d1", "a0", "a1" );
  119.   return res;
  120. }
  121.   __inline void MUI_FreeAslRequest( BASE_PAR_DECL APTR requester)
  122. {
  123.   BASE_EXT_DECL
  124.   register res __asm("d0");
  125.   register struct Library* a6 __asm("a6") = BASE_NAME;
  126.   register APTR a0 __asm("a0") = requester;
  127.  
  128.   __asm volatile ("
  129.   jsr a6@(-0x3c)"
  130.   : "=r" (res)
  131.   : "r" (a6), "r" (a0)
  132.   : "d0", "d1", "a0", "a1" );
  133. }
  134.   __inline void MUI_FreeClass( BASE_PAR_DECL struct IClass *classptr)
  135. {
  136.   BASE_EXT_DECL
  137.   register res __asm("d0");
  138.   register struct Library* a6 __asm("a6") = BASE_NAME;
  139.   register struct IClass* a0 __asm("a0")=classptr;
  140.  
  141.   __asm volatile ("
  142.   jsr a6@(-0x54)"
  143.   : "=r" (res)
  144.   : "r" (a6), "r" (a0)
  145.   : "d0", "d1", "a0", "a1" );
  146. }
  147.   __inline struct IClass* MUI_GetClass( BASE_PAR_DECL char *classname)
  148. {
  149.   BASE_EXT_DECL
  150.   register struct IClass* res __asm("d0");
  151.   register struct Library* a6 __asm("a6") = BASE_NAME;
  152.   register char* a0 __asm("a0")=classname;
  153.  
  154.   __asm volatile ("
  155.   jsr a6@(-0x4e)"
  156.   : "=r" (res)
  157.   : "r" (a6), "r" (a0)
  158.   : "d0", "d1", "a0", "a1" );
  159.   return res;
  160. }
  161.   __inline Object* MUI_MakeObjectA( BASE_PAR_DECL LONG type, ULONG *params)
  162. {
  163.   BASE_EXT_DECL
  164.   register Object* res __asm("d0");
  165.   register struct Library* a6 __asm("a6") = BASE_NAME;
  166.   register LONG d0 __asm("d0")=type;
  167.   register ULONG* a0 __asm("a0")=params;
  168.  
  169.   __asm volatile ("
  170.   jsr a6@(-0x78)"
  171.   : "=r" (res)
  172.   : "r" (a6), "r" (d0), "r" (a0)
  173.   : "d0", "d1", "a0", "a1" );
  174.   return res;
  175. }
  176.  
  177.   Object *MUI_MakeObject(LONG type, ...);
  178.  
  179.   __inline Object* MUI_NewObjectA( BASE_PAR_DECL char *classname, struct TagItem *tags)
  180. {
  181.   BASE_EXT_DECL
  182.   register Object* res __asm("d0");
  183.   register struct Library* a6 __asm("a6") = BASE_NAME;
  184.   register char* a0 __asm("a0") = classname;
  185.   register struct TagItem* a1 __asm("a1")=tags;
  186.  
  187.   __asm volatile ("
  188.   jsr a6@(-0x1e)"
  189.   : "=r" (res)
  190.   : "r" (a6), "r" (a0), "r" (a1)
  191.   : "d0", "d1", "a0", "a1" );
  192.   return res;
  193. }
  194.   Object* MUI_NewObject(char *class, Tag tag1, ...);
  195.  
  196.   __inline void MUI_Redraw( BASE_PAR_DECL Object *obj, ULONG flags)
  197. {
  198.   BASE_EXT_DECL
  199.   register res __asm("d0");
  200.   register struct Library* a6 __asm("a6") = BASE_NAME;
  201.   register Object * a0 __asm("a0")=obj;
  202.   register ULONG d0 __asm("d0")=flags;
  203.  
  204.   __asm volatile ("
  205.   jsr a6@(-0x66)"
  206.   : "=r" (res)
  207.   : "r" (a6), "r" (a0), "r" (d0)
  208.   : "d0", "d1", "a0", "a1" );
  209. }
  210.   __inline void MUI_RejectIDCMP( BASE_PAR_DECL Object *obj, ULONG flags)
  211. {
  212.   BASE_EXT_DECL
  213.   register res __asm("d0");
  214.   register struct Library* a6 __asm("a6") = BASE_NAME;
  215.   register Object* a0 __asm("a0")=obj;
  216.   register ULONG  d0 __asm("d0")=flags;
  217.  
  218.   __asm volatile ("
  219.   jsr a6@(-0x60)"
  220.   : "=r" (res)
  221.   : "r" (a6), "r" (a0), "r" (d0)
  222.   : "d0", "d1", "a0", "a1" );
  223. }
  224.   __inline LONG MUI_RequestA( BASE_PAR_DECL APTR app, APTR win,
  225. LONGBITS flags, char *title,char *gadgets,char *format,APTR params)
  226. {
  227.   BASE_EXT_DECL
  228.   register LONG res __asm("d0");
  229.   register struct Library* a6 __asm("a6") = BASE_NAME;
  230.   register APTR d0 __asm("d0")=app;
  231.   register APTR d1 __asm("d1")=win;
  232.   register LONGBITS d2 __asm("d2")=flags;
  233.   register char * a0 __asm("a0")=title;
  234.   register char * a1 __asm("a1")=gadgets;
  235.   register char * a2 __asm("a2")=format;
  236.   register APTR  a3 __asm("a3")=params;
  237.  
  238.   __asm volatile ("
  239.   jsr a6@(-0x2a)"
  240.   : "=r" (res)
  241.   : "r" (a6), "r" (d0), "r" (d1), "r" (d2), "r" (a0), "r" (a1), "r" (a2), "r" (a3)
  242.   : "d0", "d1", "a0", "a1", "d2", "a2", "a3" );
  243.   return res;
  244. }
  245.  
  246.   LONG MUI_Request(APTR app, APTR win, LONGBITS flags, char *title, char *gadgets, char *format, ...);
  247.  
  248.   __inline void MUI_RequestIDCMP( BASE_PAR_DECL Object *obj, ULONG flags)
  249. {
  250.   BASE_EXT_DECL
  251.   register res __asm("d0");
  252.   register struct Library* a6 __asm("a6") = BASE_NAME;
  253.   register Object * a0 __asm("a0")=obj;
  254.   register ULONG  d0 __asm("d0")=flags;
  255.  
  256.   __asm volatile ("
  257.   jsr a6@(-0x5a)"
  258.   : "=r" (res)
  259.   : "r" (a6), "r" (a0), "r" (d0)
  260.   : "d0", "d1", "a0", "a1" );
  261. }
  262.   __inline LONG MUI_SetError( BASE_PAR_DECL LONG num)
  263. {
  264.   BASE_EXT_DECL
  265.   register LONG res __asm("d0");
  266.   register struct Library* a6 __asm("a6") = BASE_NAME;
  267.   register LONG d0 __asm("d0")=num;
  268.  
  269.   __asm volatile ("
  270.   jsr a6@(-0x48)"
  271.   : "=r" (res)
  272.   : "r" (a6), "r" (d0)
  273.   : "d0", "d1", "a0", "a1" );
  274.   return res;
  275. }
  276.  
  277.  
  278.  
  279. #undef BASE_EXT_DECL
  280. #undef BASE_PAR_DECL
  281. #undef BASE_PAR_DECL0
  282. #undef BASE_NAME
  283.  
  284. __END_DECLS
  285.  
  286. #endif /* _INLINE_MUIMASTER_H */
  287.  
  288.  
  289.